package com.iknow.activity;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class NearByActivity extends TabActivity
{
  private Button mBackButton;
  private TabHost mHost;
  private Button mListButton;
  private Intent mListIntent;
  private Button mMapButton;
  private Intent mMapIntent;

  private TabHost.TabSpec buildTabSpec(String paramString, int paramInt1, int paramInt2, Intent paramIntent)
  {
    return this.mHost.newTabSpec(paramString).setIndicator(getString(paramInt1), getResources().getDrawable(paramInt2)).setContent(paramIntent);
  }

  private void initIntent()
  {
    this.mListIntent = new Intent(this, NearByListActivity.class);
  }

  private void initView()
  {
    setContentView(2130903100);
    this.mListButton = ((Button)findViewById(2131296463));
    this.mMapButton = ((Button)findViewById(2131296464));
    this.mBackButton = ((Button)findViewById(2131296342));
    this.mHost = getTabHost();
    this.mBackButton.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        this.this$0.finish();
      }
    });
    this.mListButton.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        NearByActivity.access$0(this.this$0).setCurrentTab(1);
        NearByActivity.access$1(this.this$0).setBackgroundResource(2130837787);
        NearByActivity.access$2(this.this$0).setBackgroundResource(2130837789);
      }
    });
    this.mMapButton.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        NearByActivity.access$0(this.this$0).setCurrentTab(0);
        NearByActivity.access$1(this.this$0).setBackgroundResource(2130837786);
        NearByActivity.access$2(this.this$0).setBackgroundResource(2130837790);
      }
    });
    this.mMapButton.setBackgroundResource(2130837790);
    this.mHost.addTab(buildTabSpec("map_tap", 2131361906, 2130837788, this.mMapIntent));
    this.mHost.addTab(buildTabSpec("list_tab", 2131361904, 2130837785, this.mListIntent));
  }

  protected void onCreate(Bundle paramBundle)
  {
    requestWindowFeature(1);
    super.onCreate(paramBundle);
    initIntent();
    initView();
  }

  protected void onDestroy()
  {
    super.onDestroy();
  }
}